var platform = uni.getSystemInfoSync().platform
function showM(text,showCancel,callback){
	console.log(platform)
	if(showCancel){
		//#ifdef MP-WEIXIN
			uni.showModal({
				title: '提示',
				content: text,
				success: (res) => {
					if (res.confirm) {
						callback && callback(1)
					} else if (res.cancel) {
						callback && callback(0)
					}
				}
			})
		//#endif
		
		//#ifndef MP-WEIXIN
			if(platform == 'android'){
				uni.showModal({
					title: '提示',
					content: text,
					cancelText: '确定',
					confirmText: '取消',
					success: (res) => {
						if (res.confirm) {
							callback && callback(0)
						} else if (res.cancel) {
							callback && callback(1)
						}
					}
				})
			}else{
				uni.showModal({ //提醒用户更新  
				    title: "提示",  
				    content: text,  
				    success: (res) => {
						if (res.confirm) {
							callback && callback(1)
						} else if (res.cancel) {
							callback && callback(0)
						}
					}  
				})
			}
		//#endif
	}else{
		uni.showModal({ //提醒用户更新  
		    title: "提示",  
		    content: text, 
			showCancel:showCancel,
		    success: (res) => {
				callback && callback(1)
			}  
		})
	}
}

function hLoading(args)  {
	uni.hideLoading()
};
//export default hideLoading;
function sLoading(args) {
	uni.showLoading({
		title:'加载中',
		mask:true
	})
};
//export default showLoading;


module.exports = {showM,hLoading,sLoading}